﻿using Godot.Collections;

public class CampfireBlockEntity : BlockEntity
{
    public int RecipeId = -1;
    public int FuelTick = 0;
    public int Pace;
    public static int MaxPace = 100;
    public Store store = new Store(4);
    public CampfireBlockEntity()
    {
        store.input = new int[] { 0 };
        store.fuel = new int[] { 1 };
        store.output = new int[] { 2, 3 };
    }
    public override Dictionary getDict()
    {
        Dictionary dict = new Dictionary();
        dict.Add("FuelTick", FuelTick);
        dict.Add("store", store.getDict());
        dict.Add("Pace", Pace);
        return dict;
    }
    public override BlockEntity JsonTo(Dictionary dict)
    {
        if (dict.Contains("store")) this.store.JsonTo((Dictionary)dict["store"]);
        this.FuelTick = dict["FuelTick"].ToInt();
        this.Pace = dict["Pace"].ToInt();
        return this;
    }
    public override Store GetStore()
    {
        return store;
    }
}